//------------------------------------------------------------------------------
// <copyright file="RequiredFolders.cs" company="Damian Antonowicz">
//       copyright © 2010 Damian Antonowicz
// </copyright>
// <author>Damian Antonowicz</author>
// <email>poczta@damianantonowicz.pl</email>
//------------------------------------------------------------------------------

using System;
using System.IO;
using DAnton.Utilities.Helpers;

namespace DotBeer.Data
{
    public static class RequiredFolders
    {
        public static void CreateDataDirectory()
        {
            CreateDirectory(Path.Combine(IOHelper.ApplicationStartupPath, "Data"));
        }

        public static void CreateHeroesDirectories()
        {
            CreateDirectory(Path.Combine(IOHelper.ApplicationStartupPath, "Heroes"));
        }

        private static void CreateDirectory(string path)
        {
            try
            {
                if (!Directory.Exists(path))
                    Directory.CreateDirectory(path);
            }
            catch
            {
                throw;
            }
        }
    }
}
